package org.jeecg.modules.simulator.util;

import org.springframework.data.redis.core.RedisTemplate;

/**
 * @program: simulator-b20240918
 * @description:
 * @author: renzhg
 * @create: 2025-01-23 14:31
 **/
public class RedisTemplateHolder {

    private static ThreadLocal<RedisTemplate> redisTemplateThreadLocal=ThreadLocal.withInitial(()->{
        RedisTemplate redisTemplate= ((RedisTemplate) SpringUtil.getBean("redisTemplate"));
        return redisTemplate;
    });

    public static RedisTemplate getRedisTemplate() {
        return redisTemplateThreadLocal.get();
    }
}
